package com.ruoyi.project.im.members.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.im.members.mapper.GroupMembersMapper;
import com.ruoyi.project.im.members.domain.GroupMembers;
import com.ruoyi.project.im.members.service.IGroupMembersService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 群用户Service业务层处理
 *
 * @author ruoyi
 * @date 2022-09-20
 */
@Service
public class GroupMembersServiceImpl implements IGroupMembersService
{
    @Autowired
    private GroupMembersMapper groupMembersMapper;

    /**
     * 查询群用户
     *
     * @param groupId 群用户主键
     * @return 群用户
     */
    @Override
    public GroupMembers selectGroupMembersByGroupId(String groupId)
    {
        return groupMembersMapper.selectGroupMembersByGroupId(groupId);
    }

    /**
     * 查询群用户列表
     *
     * @param groupMembers 群用户
     * @return 群用户
     */
    @Override
    public List<GroupMembers> selectGroupMembersList(GroupMembers groupMembers)
    {
        return groupMembersMapper.selectGroupMembersList(groupMembers);
    }

    @Override
    public GroupMembers selectGroupByMembers(GroupMembers groupMembers)
    {
        return groupMembersMapper.selectGroupByMembers(groupMembers);
    }



    /**
     * 新增群用户
     *
     * @param groupMembers 群用户
     * @return 结果
     */
    @Override
    public int insertGroupMembers(GroupMembers groupMembers)
    {
        return groupMembersMapper.insertGroupMembers(groupMembers);
    }

    /**
     * 修改群用户
     *
     * @param groupMembers 群用户
     * @return 结果
     */
    @Override
    public int updateGroupMembers(GroupMembers groupMembers)
    {
        return groupMembersMapper.updateGroupMembers(groupMembers);
    }

    /**
     * 批量删除群用户
     *
     * @param groupIds 需要删除的群用户主键
     * @return 结果
     */
    @Override
    public int deleteGroupMembersByGroupIds(String groupIds)
    {
        return groupMembersMapper.deleteGroupMembersByGroupIds(Convert.toStrArray(groupIds));
    }

    /**
     * 删除群用户信息
     *
     * @param groupId 群用户主键
     * @return 结果
     */
    @Override
    public int deleteGroupMembersByGroupId(String groupId)
    {
        return groupMembersMapper.deleteGroupMembersByGroupId(groupId);
    }
}
